/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.nextsql.renderizar;

import java.awt.Component;
import java.util.Properties;
import javax.swing.JTextPane;
import javax.swing.plaf.ComponentUI;

/**
 *
 * @author Taty
 */
public class CampoTexto extends JTextPane {
    public CampoTexto(Properties comandos) {
        super(new AcharPalavras(comandos));
        this.setBorder(new BordaNumerada());
    }
    @Override
    public boolean getScrollableTracksViewportWidth(){
        Component parent = getParent();
        ComponentUI ui = getUI();
        return parent != null ? (ui.getPreferredSize(this).width < parent.getSize().width+5) : true;
    }
}
